package cn.wolfcode.domain;

import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CustomerTraceHistory {

    public static final int RESULT_FAIL = 1;
    public static final int RESULT_NORMAL = 2;
    public static final int RESULT_DEFAULT = 3;

    private Long id;
    //跟进时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date traceTime;
    //跟进内容
    private String traceDetails;
    //跟进方式
    private SystemDictionaryItem traceType;
    //跟进结果
    private Integer traceResult;
    //客户
    private Customer customer;
    //录入人
    private Employee inputUser;
    //录入时间
    private Date inputTime;

    public String getTraceResultName() {
        switch (traceResult) {
            case RESULT_FAIL:
                return "差";
            case RESULT_NORMAL:
                return "中";
            default:
                return "优";
        }
    }
}